package com.lgj.springboot_lgj.web.controller;

import com.github.pagehelper.PageInfo;
import com.lgj.springboot_lgj.aop.Logging;
import com.lgj.springboot_lgj.bean.basic.BaseLog;
import com.lgj.springboot_lgj.bean.basic.BaseUser;
import com.lgj.springboot_lgj.service.IBaseLogService;
import com.lgj.springboot_lgj.utils.EntityUtil;
import com.lgj.springboot_lgj.utils.Result;
import com.lgj.springboot_lgj.utils.ResultUtil;
import com.lgj.springboot_lgj.web.vm.UserInsertVM;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author LDD
 * @date 2022/6/20 18:37
 */
@Api(tags = "日志模块")
@RestController
@RequestMapping("/auth/log")
public class BaseUserLogController {
    @Autowired
    private IBaseLogService service;
    @Logging
    @ApiOperation("分页查询")
    @ApiImplicitParams({
            @ApiImplicitParam(name="pageNum",value = "当前页码",required = true,dataType = "int"),
            @ApiImplicitParam(name="pageSize",value = "每页大小",required = true,dataType = "int"),
    })
    @GetMapping("/pageQuery")
    public Result pageQuery(int pageNum, int pageSize){
        PageInfo<BaseLog> pageInfo = service.pageQuery(pageNum, pageSize);
        return ResultUtil.success(pageInfo);
    }
//    @GetMapping("/pageQuery")
//    public Result addLog1(BaseLog baseLog){
//        //1.接收前端传递参数
//        //2.调用service方法
//        //3.将程序处理的结果响应给前端
//        service.addBaseLog(baseLog);
//        //方法执行成功，表示返回操作成功的提示信息
//        return ResultUtil.success("注册成功");
//    }

}
